//comm.h
#ifndef _COMM_H__
#define _COMM_H__
 
#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/sem.h>

#define SHM_SIZE 2097152

union semun{
    int val ;
    struct semid_ds *buf ;
    unsigned short *array ;
    struct seminfo *_buf ;
};

int CreateShm(const char * fname, int proj_id);
int DestroyShm(int shmid);

int CreateSem(const char * fname, int proj_id);
int InitSem(int semid, int val);
int DestroySem(int semid);
int P(int semid);
int V(int semid);

#endif
